//
//  CSinaWeibo.h
//  Delicious
//
//  Created by yilong zhang on 11-11-25.
//  Copyright 2011年 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "OAuthController.h"
#import "WeiboClient.h"

#define Sina_AppKey     @"1474837852"
#define Sina_AppSecret  @"93ef99b8fdcf7a002a679dd370f6d54a"

#define sina_AppTokenKey	@"sina_tokenKey"
#define sian_AppTokenSecret	@"sina_tokenSecret"

@protocol  SinaWeiboDelegate;

@interface CSinaWeibo : NSObject <OAuthControllerDelegate>

@property (nonatomic, assign) id<SinaWeiboDelegate>   m_SinaWeiboDelegate;

@property (nonatomic, assign) OAuthEngine  *m_Engine;
@property (nonatomic, assign) WeiboClient  *m_WeiboClient; 
@property (nonatomic, retain) NSString     *m_strUserName;
@property (nonatomic, retain) NSString     *m_strTokenKey; 
@property (nonatomic, retain) NSString     *m_strSecret;
@property (nonatomic, retain) NSString     *m_strRequestKey;

@property (nonatomic, assign) UIViewController  *m_PresentView;

+(CSinaWeibo*)DefaultSinawb;
+(void)DestroySinawb;

-(NSString*)loadDefaultKey;
-(void)saveDefaultKey;
-(void)LoginSinaWeibo:(UIViewController*)incontroller Name:(NSString*)name;
-(void)LoginSinaWeiboSuc;
-(void)LogoutSinaWeibo;
-(void)ShareToSinaWeibo:(NSString*)content ImageFile:(UIImage*)file;

@end

@protocol SinaWeiboDelegate <NSObject>

@optional
-(void)DidLoginSinaWeibo:(CSinaWeibo*)sinaweibo State:(int)state;

@end
